<cfif (fb_.verbInfo.executionMode is "start")>

	<!--- <cfif NOT IsDefined("Application.FusecacheAccessPoint")>
		<cfset Application.FusecacheAccessPoint = Application.beanFactory.getBean('FusecacheFactory') />
	</cfif> --->
	
	<cfset fb_.verbInfo.temp = StructNew() />
	<cfset fb_.verbInfo.temp.append = false />
	<cfset fb_.verbInfo.temp.prepend = false />
	<cfset fb_.verbInfo.temp.fuseaction = fb_.verbInfo.attributes.action />
	<!--- <cfset fb_.verbInfo.temp.oFusecacheItem = Application.FusecacheAccessPoint.getFusecacheItem(fb_.verbInfo.temp.fuseaction) /> --->

	<cfif IsDefined("fb_.verbInfo.attributes.append")>
		<cfset fb_.verbInfo.temp.append = true />
	</cfif>
	
	<cfif IsDefined("fb_.verbInfo.attributes.prepend")>
		<cfset fb_.verbInfo.temp.prepend = true />
	</cfif>
	
	<cfscript>
		fb_appendLine("<!-- START FCACHE:DO -->");
		fb_appendLine("<cfset Variables.oFusecacheItem = Application.FusecacheAccessPoint.getFusecacheItem('#fb_.verbInfo.temp.fuseaction#') />");
		fb_appendLine("<cfif (Variables.oFusecacheItem.getFoundInSettings())>");
			
			fb_appendLine("<cfswitch expression='##Variables.oFusecacheItem.getType()##'>");
				fb_appendLine("<cfcase value='partial-simple'>");
					fb_appendLine("<cfset Variables.oFusecacheItem.retrieveCacheData() />");
				fb_appendLine("</cfcase>");
				
				fb_appendLine("<cfcase value='partial-conditional|partial-variable' delimiters='|'>");
					fb_appendLine("<cfif (Variables.oFusecacheItem.hasConditions())>");
						fb_appendLine("<cfset Variables.lsNeededScopes = Variables.oFusecacheItem.getScopesFromConditionsOrVariables() />");
						fb_appendLine("<cfset Variables.stScopes = StructNew() />");
						fb_appendLine("<cfloop from='1' to='##ListLen(Variables.lsNeededScopes)##' index='i'>");
							fb_appendLine("<cfif (ListGetAt(Variables.lsNeededScopes,1) NEQ 'Session') OR (Application.GetApplicationSettings().SessionManagement)>");
								fb_appendLine("<cfset 'Variables.stScopes.##ListGetAt(Variables.lsNeededScopes,1)##' = Evaluate(ListGetAt(Variables.lsNeededScopes,1)) />");
							fb_appendLine("</cfif>");
						fb_appendLine("</cfloop>");
						fb_appendLine("<cfset Variables.oFusecacheItem.testConditionsOrVariables(Variables.stScopes) />");
					fb_appendLine("</cfif>");
				fb_appendLine("</cfcase>");
			fb_appendLine("</cfswitch>");
							

			fb_appendLine("<cfif (Variables.oFusecacheItem.getFoundInCache())>");
			if (IsDefined("fb_.verbInfo.attributes.contentvariable")) {
				fb_appendLine("<cfsavecontent variable='#fb_.verbInfo.attributes.contentvariable#'>");
				fb_appendLine("<cfoutput>");
				if (fb_.verbInfo.temp.append) {
					fb_appendLine("##" & "#fb_.verbInfo.attributes.contentvariable#" & "##");
				}
				fb_appendLine("##Variables.oFusecacheItem.getCacheData()##");
				if (fb_.verbInfo.temp.prepend) {
					fb_appendLine("##" & "#fb_.verbInfo.attributes.contentvariable#" & "##");
				}
				fb_appendLine("</cfoutput>");
				fb_appendLine("</cfsavecontent>");
				
			}
			else {
				fb_appendLine("<cfoutput>##Variables.oFusecacheItem.getCacheData()##</cfoutput>");
			}
			fb_appendLine("<cfelse>");
				fb_appendLine("<cfset Variables.fCacheLexiconContent = Variables.myFusebox.do(action='#fb_.verbInfo.temp.fuseaction#',contentvariable='Variables.fCacheLexiconContent',returnOutput='true') />");
				fb_appendLine("<cfset Variables.oFusecacheItem.saveCacheData(Variables.fCacheLexiconContent) />");
				if (IsDefined("fb_.verbInfo.attributes.contentvariable")) {
					fb_appendLine("<cfsavecontent variable='#fb_.verbInfo.attributes.contentvariable#'>");
					fb_appendLine("<cfoutput>");
					if (fb_.verbInfo.temp.append) {
						fb_appendLine("##" & "#fb_.verbInfo.attributes.contentvariable#" & "##");
					}
					fb_appendLine("##Variables.fCacheLexiconContent##");
					if (fb_.verbInfo.temp.prepend) {
						fb_appendLine("##" & "#fb_.verbInfo.attributes.contentvariable#" & "##");
					}
					fb_appendLine("</cfoutput>");
					fb_appendLine("</cfsavecontent>");
					
				}
				else {
					fb_appendLine("<cfoutput>##Variables.oFusecacheItem.getCacheData()##</cfoutput>");
				}
			fb_appendLine("</cfif>");
		fb_appendLine("<cfelse>");
			fb_appendLine("<cfthrow type='fusecache.missingSetting' message='Missing Fusecache Setting' detail='You tried running an fcache:do but no corresponding setting data was found in your Fusecache XML configuration file. (fuseaction)'>");
		fb_appendLine("</cfif>");
	</cfscript> 
	
<cfelse>

	<cfscript>
		fb_appendLine("<!-- END FCACHE:DO -->");
	</cfscript>
	
</cfif>